package com.sskj.tibi.presenter;

import com.lzy.okgo.model.Response;
import com.sskj.common.base.HttpData;
import com.sskj.lib.http.JsonCallBack;
import com.sskj.tibi.bean.RechargeBean;
import com.sskj.tibi.bean.WithdrawRechargeCoinBean;
import com.sskj.tibi.http.HttpConfig;
import com.sskj.tibi.ui.fragment.RechargeFragment;

import java.util.List;


public class RechargeFragmentPresenter extends BasePresenter<RechargeFragment> {

    public void getData() {
        httpService.recharge()
                .execute(new JsonCallBack<HttpData<RechargeBean>>() {
                    @Override
                    public void onSuccess(Response<HttpData<RechargeBean>> response) {
                        HttpData<RechargeBean> httpData = response.body();
                        if (httpData.getStatus() == HttpConfig.OK) {
                            mView.updateUI(httpData.getData());
                        }
                    }
                });
    }

//    public void coinList() {
//        httpService.coinList()
//                .execute(new JsonCallBack<HttpData<List<WithdrawRechargeCoinBean>>>(this) {
//                    @Override
//                    public void onSuccess(Response<HttpData<List<WithdrawRechargeCoinBean>>> response) {
//                        HttpData<List<WithdrawRechargeCoinBean>> httpData = response.body();
//                        if (httpData.getStatus() == HttpConfig.OK) {
//
//                            mView.updateCoinList(httpData.getData());
//                        }
//                    }
//                });
//    }
}
